import { FormSchema } from '@/components/Table'
import dayjs from 'dayjs'

export const searchFormSchema: FormSchema[] = [
  {
    field: 'classifyId',
    label: '所属科室',
    slot: 'classifyId',
    colProps: { span: 6 },
  },
  {
    field: '[startDate, endDate]',
    label: '选择时间',
    component: 'RangePicker',
    colProps: { span: 6 },
    // 这里两次赋值方法有些繁琐，目前没找到更好的解决方案
    defaultValueObj: {
      startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
      endDate: dayjs().endOf('month').format('YYYY-MM-DD'),
    },
    componentProps: {
      allowClear: false,
      defaultValue: [
        dayjs().startOf('month').format('YYYY-MM-DD'),
        dayjs().endOf('month').format('YYYY-MM-DD'),
      ],
      valueFormat: 'YYYY-MM-DD',
    },
  },
  {
    field: 'tag',
    label: '标签名',
    component: 'Input',
    colProps: { span: 6 },
  },
]

export const modalSearchFormSchema: FormSchema[] = [
  {
    field: 'tag',
    label: '标签名',
    component: 'Input',
    colProps: { span: 6 },
  },
]

export const modalColumns = [
  {
    title: '标签名',
    dataIndex: 'classifyName',
  },
  {
    title: '标签描述',
    dataIndex: 'description',
  },
]
